CREATE TABLE [dbo].[TMCONV_MONE]
(
[CO_MONE_ORIG] [dbo].[TD_VC_003] NOT NULL,
[CO_MONE_DEST] [dbo].[TD_VC_003] NOT NULL,
[CO_MON1] [dbo].[TD_VC_003] NULL,
[CO_MONE_BAS1] [dbo].[TD_VC_003] NULL,
[TI_OPE1] [dbo].[TD_VC_001] NULL,
[CO_MON2] [dbo].[TD_VC_003] NULL,
[CO_MONE_BAS2] [dbo].[TD_VC_003] NULL,
[TI_OPE2] [dbo].[TD_VC_001] NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TMCONV_MO__CO_US__656C112C] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TMCONV_MO__FE_US__66603565] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TMCONV_MO__CO_US__6754599E] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TMCONV_MO__FE_US__68487DD7] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TMCONV_MONE] ADD CONSTRAINT [PK__TMCONV_M__D63E87DC004002F9] PRIMARY KEY CLUSTERED  ([CO_MONE_ORIG], [CO_MONE_DEST]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TMCONV_MONE] ADD CONSTRAINT [FK__TMCONV_MONE__347EC10E] FOREIGN KEY ([CO_MON1], [CO_MONE_BAS1]) REFERENCES [dbo].[TMFACT_CAMB] ([CO_MONE], [CO_MONE_BASE])
GO
ALTER TABLE [dbo].[TMCONV_MONE] ADD CONSTRAINT [FK__TMCONV_MONE__338A9CD5] FOREIGN KEY ([CO_MON2], [CO_MONE_BAS2]) REFERENCES [dbo].[TMFACT_CAMB] ([CO_MONE], [CO_MONE_BASE])
GO
ALTER TABLE [dbo].[TMCONV_MONE] ADD CONSTRAINT [FK__TMCONV_MO__CO_MO__3572E547] FOREIGN KEY ([CO_MONE_DEST]) REFERENCES [dbo].[TTMONE] ([CO_MONE])
GO
ALTER TABLE [dbo].[TMCONV_MONE] ADD CONSTRAINT [FK__TMCONV_MO__CO_MO__36670980] FOREIGN KEY ([CO_MONE_ORIG]) REFERENCES [dbo].[TTMONE] ([CO_MONE])
GO
GRANT SELECT ON  [dbo].[TMCONV_MONE] TO [public]
GRANT INSERT ON  [dbo].[TMCONV_MONE] TO [public]
GRANT DELETE ON  [dbo].[TMCONV_MONE] TO [public]
GRANT UPDATE ON  [dbo].[TMCONV_MONE] TO [public]
GO
